<template>
  <div class="flex items-center ">
    <el-form-item :label="label + '最小值'">
      <el-input-number v-model="min"></el-input-number>
    </el-form-item>
    <el-form-item :label="label + '最大值'" class="m-l-24">
      <el-input-number v-model="max"></el-input-number>
    </el-form-item>
  </div>
</template>

<script>
export default {
  props:["label","prop",'value'],
  data:() => ({
    min:0,
    max:0,
  }),
  methods:{
    update(){
      this.$emit('input',[this.min,this.max])
    }
  },
  watch:{
    min(){
      this.update();
    },
    max(){
      this.update();
    },
  },
  created(){
    if(this.value){
      this.min = this.value[0] || undefined;
      this.max = this.value[1] || undefined;
    }
  }
}
</script>